<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>hello ws</title>
	</head>
	<body>
		
		<div> WebSocket client </div>
		
		

		
		<script>
		  var socket = new WebSocket("ws://localhost:8080");
		
		  socket.onopen = function(event) {
		    console.log("WebSocket connected");
		    socket.send("Hello, server!");
		  };
		
		  socket.onmessage = function(event) {
		    console.log("Received message:", event.data);
		  };
		
		  socket.onerror = function(event) {
		    console.error("WebSocket error:", event);
		  };
		</script>
		
	</body>
</html>